#pragma once
//Include do Irrlicht
#include <irrlicht.h>
#include "Camera.h"

//Usar os namespaces da engine
using namespace irr;
using namespace video;
using namespace scene;
using namespace core;
using namespace gui;


class TrataEventos : public IEventReceiver
{
public:
	TrataEventos(void);
	~TrataEventos(void);
	bool OnEvent(const SEvent& event);
	bool IsKeyDown(EKEY_CODE keyCode);

	void pegaCam(Camera*cam);
	Camera* getCam(Camera*cam);
	Camera* getCam();

	bool IsKeysDown(EKEY_CODE keyCode);
private:
	//Armazena o estado das teclas pressionadas
	bool KeyIsDown[KEY_KEY_CODES_COUNT];

	Camera *cam;
	ICursorControl* CursorControl; 
	// keyboard registry
	bool keys[irr::KEY_KEY_CODES_COUNT];
	// mouse registry
	bool mouseDownL;
	bool mouseDownM;
	bool mouseDownR;
	f32 lastWheelMovement;
	position2d<f32> cursor;
	position2d<f32> cursorOld;
	position2d<f32> cursorDelta; 
};
